Our character must jump to avoid enemies. We will use the space bar to do this.

  • Add a Space Bar event that will allow the user to make the character jump.
  • Go to , drag out Set x Speed. Change the name to snake.
  • Drag Random Integer INSIDE the parenthesis and select a range for the speed.
  • Turn Sprite Gravity On. Change the name to snake. Repeat these steps for the two other enemies.

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)